<?
	require_once "../../_func/__Global.php";
	require_once "../../_func/__Local.php";
	require_once "../../_func/__MysqlFunc.php";
	require_once "../../_func/_CodeFunc.php";
?>
<?
	$db = GetDefaultConnection();
	$seq = $param->getString('seq');

	$queryarry = array(
		'T_PRODUCT_SEQ' => $seq,
	);

	$query=makeWhereQry($queryarry);

	if ($query != "")
		$where .= " and ". $query;

	$sql = sprintf("SELECT T_PRODUCT_DATE, T_PRODUCT_WEIGHT2, T_PRODUCT_TOTAL, b.FARM_NAME "
					.", (select JBNH_NAME FROM TB_JBNH WHERE JBNH_SEQ=a.JBNH_SEQ) as JBNH_NAME "
					.", (select CODE_NAME FROM TB_CODE WHERE CODE_TYPE='A' AND CODE_CODE1=a.T_PRODUCT_ITEM1 AND CODE_CODE2=0) as ITEM1_NAME "
					.", (select CODE_NAME FROM TB_CODE WHERE CODE_TYPE='A' AND CODE_CODE1=a.T_PRODUCT_ITEM1 AND CODE_CODE2=a.T_PRODUCT_ITEM2) as ITEM2_NAME "
					." FROM TB_PRODUCT_TEMP a inner join TB_FARM b on a.FARM_SEQ=b.FARM_SEQ where 1=1 %s "
					, $where);
	$list = $db->queryList($sql);

	if ($list != null)
	{
		$row = & $list->next();
		$t_product_date = $row->getString('T_PRODUCT_DATE');
		$t_product_weight2 = $row->getNumber('T_PRODUCT_WEIGHT2');
		$t_product_total = $row->getNumber('T_PRODUCT_TOTAL');
		$farm_name = $row->getString('FARM_NAME');
		$jbnh_name = $row->getString('JBNH_NAME');
		$item1_name = $row->getString('ITEM1_NAME');
		$item2_name = $row->getString('ITEM2_NAME');
	}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>{상호명들어가는부분} 입고확인증</title>
</head>
<body>
<table cellpadding="0" cellspacing="0" border="0" width="1000" style="margin:auto;">
<tr>
<td style="vertical-align:top; border-right:2px dotted">

<table cellpadding="10" cellspacing="1" border="0" width="420" style="font-family:Malgun gothic; line-height:120%; font-size:17px; border-collapse:collapse; border:2px solid #333333;">
	<tr>
		<td height="40" style="text-align:center; font-size:25px; font-weight:bold;">
			<span style="border-bottom:3px double; padding:0 10px 6px;">입 고 확 인 증</span>
		</td>
	</tr>
	<tr>
		<td height="30" style="text-align:center; padding:0 0 10px 0">(APC보관용)</td>
	</tr>
	<tr>
		<td align="center">
			<table cellpadding="5" cellspacing="0" border="0" width="320" style="font-size:16px;">
				<colgroup>
					<col width="110px" />
					<col width="2px"/>
					<col width="178px"/>
					<col width="30px"/>
				</colgroup>
				<tr>
					<td>사업구분</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"></td>
				</tr>
				<tr>
					<td>소속농협</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"><?=$jbnh_name?></td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:12px; text-indent:9px;">품 종</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"><?=$item2_name?></td>
				</tr>
				<tr>
					<td>농가번호</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"></td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:8px; text-indent:8px;">농가명</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"><?=$farm_name?></td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:8px; text-indent:8px;">입고량</td>
					<td>:</td>
					<td style="text-align:left; text-indent:5px;"></td>
					<td style="text-align:left">(PVC)</td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:8px; text-indent:8px;">총중량</td>
					<td>:</td>
					<td style="text-align:left; text-indent:5px;"><?=$t_product_total?></td>
					<td style="text-align:left">(kg)</td>
				</tr>
				<tr>
					<td>평균중량</td>
					<td>:</td>
					<td style="text-align:left; text-indent:5px;"><?=$t_product_weight2?></td>
					<td style="text-align:left">(kg)</td>
				</tr>
				<tr>
					<td>운송주체</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td align="center" style="font-family:batang; font-size:18px; padding:30px 0; ">위의 내용과 같이 입고 되었음을 확인합니다.</td>
	</tr>
	<tr>
		<td align="center"><?=date_format(new DateTime($t_product_date),'Y년 m월 d일')?></td>
	</tr>
	<tr>
		<td align="center" style="padding:20px 0 80px 0;">
		농가확인 : <span style="padding-left:200px;">(인)</span><BR />
		APC확인 : <span style="padding-left:200px;">(인)</span></td>
	</tr>
</table>

</td>
<td align="right" style="padding-right:9px; vertical-align:top">

<table cellpadding="10" cellspacing="1" border="0" width="420" style="font-family:Malgun gothic; line-height:120%; font-size:17px; border-collapse:collapse; border:2px solid #333333;">
	<tr>
		<td height="40" style="text-align:center; font-size:25px; font-weight:bold;">
			<span style="border-bottom:3px double; padding:0 10px 6px;">입 고 확 인 증</span>
		</td>
	</tr>
	<tr>
		<td height="30" style="text-align:center; padding:0 0 10px 0">(농가보관용)</td>
	</tr>
	<tr>
		<td align="center">
			<table cellpadding="5" cellspacing="0" border="0" width="320" style="font-size:16px;">
				<colgroup>
					<col width="110px" />
					<col width="2px"/>
					<col width="178px"/>
					<col width="30px"/>
				</colgroup>
				<tr>
					<td>사업구분</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"></td>
				</tr>
				<tr>
					<td>소속농협</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"><?=$jbnh_name?></td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:12px; text-indent:9px;">품 종</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"><?=$item2_name?></td>
				</tr>
				<tr>
					<td>농가번호</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"></td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:8px; text-indent:8px;">농가명</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"><?=$farm_name?></td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:8px; text-indent:8px;">입고량</td>
					<td>:</td>
					<td style="text-align:left; text-indent:5px;"></td>
					<td style="text-align:left">(PVC)</td>
				</tr>
				<tr>
					<td style="text-align:center; letter-spacing:8px; text-indent:8px;">총중량</td>
					<td>:</td>
					<td style="text-align:left; text-indent:5px;"><?=$t_product_total?></td>
					<td style="text-align:left">(kg)</td>
				</tr>
				<tr>
					<td>평균중량</td>
					<td>:</td>
					<td style="text-align:left; text-indent:5px;"><?=$t_product_weight2?></td>
					<td style="text-align:left">(kg)</td>
				</tr>
				<tr>
					<td>운송주체</td>
					<td>:</td>
					<td colspan="2" style="text-align:left; text-indent:5px;"></td>
				</tr>
			</table>
		</td>
	</tr>
	<tr>
		<td align="center" style="font-family:batang; font-size:18px;  padding:30px 0; ">위의 내용과 같이 입고 되었음을 확인합니다.</td>
	</tr>
	<tr>
		<td align="center"><?=date_format(new DateTime($t_product_date),'Y년 m월 d일')?></td>
	</tr>
	<tr>
		<td align="center" style="padding:20px 0 40px 0;">
		농가확인 : <span style="padding-left:200px;">(인)</span><BR />
		APC확인 : <span style="padding-left:200px;">(인)</span></td>
	</tr>
	<tr>
		<td align="center">망성농업협동조합 산지유통센터</td>
	</tr>
</table>


</td>
</tr>
</table>
</body>
</html>
